package com.rdd.transformation

import org.apache.spark.{SparkConf, SparkContext}

object testFilter {

  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local").setAppName("testFilter")
    val sc = new SparkContext(conf)

    val file = sc.textFile("src\\main\\scala\\testTxt.txt")
    val value = file.filter(x => {
      if (x.contains("hello")) {
        true
      } else {
        false
      }
    })
    value.foreach(println)

    sc.stop()
  }
}
